
<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

    <title>Repeat &#8212; LAVA 2024.05 documentation</title>
    <link rel="stylesheet" type="text/css" href="_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="_static/bootstrap-sphinx.css" />
    <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
    <script src="_static/doctools.js"></script>
    <script src="_static/sphinx_highlight.js"></script>
    <link rel="shortcut icon" href="_static/favicon.ico"/>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Protocol Reference" href="actions-protocols.html" />
    <link rel="prev" title="Command Action Reference" href="actions-command.html" />
    <link rel="canonical" href="https://docs.lavasoftware.org/lava/actions-repeats.html" />
  
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
<script type="text/javascript" src="_static/js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="_static/js/jquery-fix.js"></script>
<script type="text/javascript" src="_static/bootstrap-3.4.1/js/bootstrap.min.js"></script>
<script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>


  </head><body>

  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
    <div class="container">
      <div class="navbar-header">
        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="index.html"><span><img src="_static/lava.png"></span>
          LAVA</a>
        <span class="navbar-text navbar-version pull-left"><b>2024.05</b></span>
      </div>

        <div class="collapse navbar-collapse nav-collapse">
          <ul class="nav navbar-nav">
            
                <li><a href="genindex.html">Index</a></li>
                <li><a href="contents.html">Contents</a></li>
            
            
              <li class="dropdown globaltoc-container">
  <a role="button"
     id="dLabelGlobalToc"
     data-toggle="dropdown"
     data-target="#"
     href="index.html">Site <b class="caret"></b></a>
  <ul class="dropdown-menu globaltoc"
      role="menu"
      aria-labelledby="dLabelGlobalToc"><ul class="current">
<li class="toctree-l1"><a class="reference internal" href="index.html">Introduction to LAVA</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="contents.html">Contents</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="glossary.html">Glossary of terms</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="support.html">Getting support</a></li>
</ul>
</ul>
</li>
              
                <li class="dropdown">
  <a role="button"
     id="dLabelLocalToc"
     data-toggle="dropdown"
     data-target="#"
     href="#">Page <b class="caret"></b></a>
  <ul class="dropdown-menu localtoc"
      role="menu"
      aria-labelledby="dLabelLocalToc"><ul>
<li><a class="reference internal" href="#">Repeat</a><ul>
<li><a class="reference internal" href="#handling-repeats">Handling repeats</a><ul>
<li><a class="reference internal" href="#repeating-single-actions">Repeating single actions</a><ul>
<li><a class="reference internal" href="#retry-on-failure">Retry on failure</a></li>
<li><a class="reference internal" href="#retry-interval-on-failure">Retry interval on failure</a></li>
</ul>
</li>
<li><a class="reference internal" href="#repeating-blocks-of-actions">Repeating blocks of actions</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</ul>
</li>
              
            
            
              
                
  <li>
    <a href="actions-command.html" title="Previous Chapter: Command Action Reference"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; Command Actio...</span>
    </a>
  </li>
  <li>
    <a href="actions-protocols.html" title="Next Chapter: Protocol Reference"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">Protocol Reference &raquo;</span>
    </a>
  </li>
              
            
            
            
            
              <li class="hidden-sm"></li>
            
          </ul>

          
            
<form class="navbar-form navbar-right" action="search.html" method="get">
 <div class="form-group">
  <input type="text" name="q" class="form-control" placeholder="Search" />
 </div>
  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>
          
        </div>
    </div>
  </div>

<div class="container">
  <div class="row">
    <div class="body col-md-12 content" role="main">
      
  <section id="repeat">
<span id="repeat-action"></span><h1>Repeat<a class="headerlink" href="#repeat" title="Permalink to this heading">¶</a></h1>
<p>See <a class="reference internal" href="#repeats"><span class="std std-ref">Handling repeats</span></a>.</p>
<section id="handling-repeats">
<span id="repeats"></span><h2>Handling repeats<a class="headerlink" href="#handling-repeats" title="Permalink to this heading">¶</a></h2>
<p>Selected Actions within the dispatcher support repeating an individual action
(along with any internal pipelines created by that action) - these are
determined within the codebase.</p>
<section id="repeating-single-actions">
<span id="repeat-single-action"></span><h3>Repeating single actions<a class="headerlink" href="#repeating-single-actions" title="Permalink to this heading">¶</a></h3>
<p>Selected actions (<code class="docutils literal notranslate"><span class="pre">RetryAction</span></code>) within a pipeline (as determined by the
Strategy) support repetition of all actions below that point. There will only
be one <code class="docutils literal notranslate"><span class="pre">RetryAction</span></code> per top level action in each pipeline. e.g. a top level
<a class="reference internal" href="actions-boot.html#boot-action"><span class="std std-ref">Boot Action Reference</span></a> action for U-Boot would support repeating the attempt to
boot the device but not the actions which substitute values into the U-Boot
commands as these do not change between boots (only between deployments).</p>
<section id="retry-on-failure">
<span id="failure-retry"></span><h4>Retry on failure<a class="headerlink" href="#retry-on-failure" title="Permalink to this heading">¶</a></h4>
<p>Individual actions can be retried a specified number of times if the a
<a class="reference internal" href="dispatcher-design.html#job-error-exception"><span class="std std-ref">JobError Exception</span></a> or <a class="reference internal" href="dispatcher-design.html#infrastructure-error-exception"><span class="std std-ref">InfrastructureError Exception</span></a> is raised
during the <code class="docutils literal notranslate"><span class="pre">run</span></code> step by this action or any action within the internal
pipeline of this action.</p>
<p>Specify the number of retries which are to be attempted if a failure is
detected using the <code class="docutils literal notranslate"><span class="pre">failure_retry</span></code> parameter.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">deploy</span><span class="p">:</span>
<span class="w">   </span><span class="nt">failure_retry</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">3</span>
</pre></div>
</div>
</section>
<section id="retry-interval-on-failure">
<span id="failure-retry-interval"></span><h4>Retry interval on failure<a class="headerlink" href="#retry-interval-on-failure" title="Permalink to this heading">¶</a></h4>
<p>By default, individual action would be retried after 1 second, but you could
specify <code class="docutils literal notranslate"><span class="pre">failure_retry_interval</span></code> to increase the interval between retries.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">deploy</span><span class="p">:</span>
<span class="w">   </span><span class="nt">failure_retry_interval</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">10</span>
</pre></div>
</div>
<p>RetryActions will only repeat if a <a class="reference internal" href="dispatcher-design.html#job-error-exception"><span class="std std-ref">JobError Exception</span></a> or
<a class="reference internal" href="dispatcher-design.html#infrastructure-error-exception"><span class="std std-ref">InfrastructureError Exception</span></a> exception is raised in any action inside
the internal pipeline of that action. This allows for multiple actions in any
one deployment to be RetryActions without repeating unnecessary tasks. e.g.
download is a RetryAction to allow for intermittent internet issues with third
party downloads.</p>
</section>
</section>
<section id="repeating-blocks-of-actions">
<h3>Repeating blocks of actions<a class="headerlink" href="#repeating-blocks-of-actions" title="Permalink to this heading">¶</a></h3>
<p>To repeat block of actions, it’s advised to use a templating engine, like
jinja2, and to use it to generate a job definition where the blocks are
repeated. <code class="docutils literal notranslate"><span class="pre">repeat</span></code> parameter is currently not supported in LAVA.</p>
</section>
</section>
</section>


    </div>
      
  </div>
</div>
<footer class="footer">
  <div class="container">
    <p class="pull-right">
      <a href="#">Back to top</a>
      
    </p>
    <p>
        &copy; Copyright 2010-2019, Linaro Limited.<br/>
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 5.3.0.<br/>
    </p>
  </div>
</footer>
  </body>
</html>